#ifndef MATRIX_UTILS_H
#define MATRIX_UTILS_H

#include <stdint.h>
#include <string>
#include <vector>

namespace Utils
{
    class Matriz
    {
    public:
    	Matriz(const uint32_t rows, const uint32_t columns);
    	Matriz(const Matriz& matriz);
    	~Matriz();

    public:
        Matriz& operator=(const Matriz& matriz);

    public:
    	double * const mData;
    	
    	const uint32_t mRows;
    	const uint32_t mColumns;
    };

    void PrintMatrix(const Matriz& matriz);

    Matriz AddMatrices(const Matriz& a, const Matriz& b);

    Matriz SubtractMatrices(const Matriz& a, const Matriz& b);

    Matriz MultiplyMatrices(const Matriz& a, const Matriz& b);

    Matriz MultiplyMatrixByLiteral(const Matriz& matrix, const double lit);

    // Build matrix from a file specifying the file
    // path with the numbers to build the matrix, the number
    // of rows and the numbers of columns.
    Matriz GetMatrixFromFile(const std::string& filePath, const uint32_t rows, const uint32_t columns);

    // Returns the absolute value of the matrix.
    Matriz GetAbsoluteMatrix(const Matriz& matrix);

    // Get the max element of the matrix.
    double GetMaxElement(const Matriz& matrix);

    // Get the infinite norm of a vector matrix (nx1)
    double GetInfiniteVectorNorm(const Matriz& vector);

    // Get the first order norm of a vector matrix (nx1)
    double GetFirstOrderVectorNorm(const Matriz& vector);

    // Add all the elements of a matrix and returns it.
    double AddMatrixElements(const Matriz& matrix);

    void WriteMatrixToFile(const std::string& filePath, const Matriz& matrix);
}

#endif // MATRIX_UTILS_H
